<<!DOCTYPE html>
<html>
<head>
	<title>数组创建 赋值</title>
	<script type="text/javascript">
	var str='hahahahahhahahahhah'+'wowowowowoowo';
	console.log(str);

	// 使用join来连接字符串 而不是+
	// 
	
	var items,messages,length, i;

	messages = [{
	    state: 'success',
	    message: 'This one worked.'
	},{
	    state: 'success',
	    message: 'This one worked as well.'
	},{
	    state: 'error',
	    message: 'This one did not work.'
	}];

	length = messages.length;

	// good
	function inbox(messages) {
	  items = [];

	  for (i = 0; i < length; i++) {
	    items[i] = messages[i].message;
	  }

	  return '<ul><li>' + items.join('</li><li>') + '</li></ul>';
	}

	</script>
</head>
<body>
	
</body>
</html>